<!doctype html>
<html>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%
    String path = request.getContextPath();
%>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="css/common.css"/>
    <link rel="stylesheet" type="text/css" href="css/main.css"/>
    <script type="text/javascript" src="js/libs/modernizr.min.js"></script>
    <jsp:include page="/manage/inc/header"></jsp:include>
</head>
<body>
    <!--/sidebar-->
    <div class="main-wrap">

        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="index.html">首页</a><span class="crumb-step">&gt;</span><span class="crumb-name">管理员列表</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
            </div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                    </div>
                </div>
                <div class="result-content" id="show">

                </div>
            </form>
        </div>
    </div>
    <!--/main-->
</div>
</body>
<jsp:include page="/manage/inc/footer"></jsp:include>
<script>
    $(function () {
        initData(1);
    })
    function initData(pageNum) {
     var action = "<%=path%>/manage/ajaxJsp/adminShow";
    $.post(action,{pageNum:pageNum},function (mes) {
       $("#show").html(mes)
    })

        $.ajaxSettings.async = false;
        $(function () {
            $("#show").on("click",".link-del",function () {
                var id = $(this).data("id")
                layer.prompt({
                    formType: 2,
                    title: '请输入禁用理由'
                }, function(value, index, elem){
                    var action= "<%=path%>/manage/Reason";
                    var deleteReason = value;
                    $.post(action,{deleteReason:deleteReason,id:id},function () {
                        layer.close(index);
                        layer.confirm("确认要禁用此账号吗",function () {
                            var url="<%=path%>/manage/admin/banned"
                            $.post(url,{id:id},function (mes) {
                                layer.msg("已经禁用")
                                initData(pageNum)
                            })
                        })
                    })

                });
            })
        })











      /*  $.ajaxSettings.async = false;
        $(function () {
            $("#show").on("click",".link-del",function () {
                var id = $(this).data("id")
                alert(id)
                layer.confirm("确定要禁用此账号吗",function () {
                    var url="<%=path%>/manage/admin/banned"
                    $.post(url,{id:id},function (mes) {
                        layer.msg("已经禁用")
                        initData(pageNum)
                    })
                })
            })
        })*/
        $.ajaxSettings.async = false;
        $(function () {
            $("#show").on("click",".link-dell",function () {
                var id = $(this).data("id")
                layer.confirm("确定要激活此账号吗",function () {
                    var url="<%=path%>/manage/admin/deblocking"
                    $.post(url,{id:id},function (mes) {
                        layer.msg("已经激活")
                        initData(pageNum)
                    })
                })
            })
        })

    }

</script>
</html>